<template>
	<div>
		<div id="shopp_cart">

			<div v-if="isLogin">
				<div v-for="l in [1,2,3,4,5,6]" class="cart">
					<h2 class="store_title">易果生鲜<span class="sprite-icon"></span></h2>
					<dl class="cart_main">
						<dt class="img">
							<img src="../../assets/images/shoppingcart/inter.png">
						</dt>
						<dd class="cart_con">
							<span class="cart_c_txt">Dior/迪奥小姐花漾淡香氛50ml 甜心女士淡香 EDT 清新甜美</span>
							<p class="cart_c_money">规格：50ml</p>


							<div class='select-count' style="text-align: right;display: block;">
								<div class="count-btn">
									<button class="count-min" @click="Count--">-</button>
									<input min="1" type="number" style="text-align: center;width: 10vw;border: 1px solid #f3f3f3;height: 2rem;vertical-align: top;"
									 v-model="Count">
									<button class="count-plus" @click="Count++">+</button>
								</div>
							</div>

						</dd>
					</dl>
					<div class="db"></div>
				</div>
				<div class="con_sub cart_che">
					<span class="con_color cart_main fl">
						合计:<font>2600积分</font>
						<font class="cart_money">(不包含运费)</font>
					</span>
					<a href="Fill_order.html" class="con_ti fr">确认提交</a>
				</div>
			</div>
			<div else>
				<p>
					<router-link to="/Member">
						<span class="inco_txt">登录</span>
					</router-link>
					<span>后查看购物车</span>
				</p>
			</div>
		</div>
		<Footer></Footer>
	</div>

</template>
<script>
	import Footer from "@/components/common/_footer.vue"
	export default {
		data() {
			return {
				Count: 1,
				isLogin: false
			}
		},
		components: {
			Footer
		},
		beforeCreate: function() {
			//组件实例刚刚被创建，但组件属性尚未
			//alert(config.ApiUrl);
			document.title = '我的购物车';
		},

		mounted: function() {
			let self = this;
			document.querySelectorAll(".aui-slide-item-item").forEach(function(v) {
				v.addEventListener('click', () => {
					console.log(self);
					self.$router.push('/GoodsDetail')
				})
			});
			document.querySelectorAll(".aui-list-product-item").forEach(function(v) {
				v.addEventListener('click', () => {
					console.log(self);
					self.$router.push('/GoodsDetail')
				})
			});
		}
	}
</script>

<style>
	.cart>h2,
	.cart>dl {
		padding: .5rem 1rem;
	}

	.store_title {
		border-bottom: 1px solid #d1d1d1;
	}

	.cart_main {
		display: flex;
	}

	.cart_main .img {
		font-size: 0;
		flex: 1;
	}

	.cart_main .img img {
		width: 100%;
	}

	.cart_main .cart_con {
		flex: 3;
	}

	.cart_c_txt {
		font-size: 1.4rem;
		color: #494949;
	}
</style>
